package com.panny.newcar.main;

import java.sql.Connection;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import com.panny.newcar.crawl.NewCarCrawl;
import com.panny.newcar.dao.NewCarDao;
import com.panny.newcar.util.ConnectionPool;

public class MainTemp {
	public static void main(String[] args) {
		start(10);
	}

	public static void start(int threadCount) {
		ExecutorService fixexecutorservice = Executors.newFixedThreadPool(threadCount);
		Connection currConn = ConnectionPool.getConnection("qczj001", "root", "123456", "localhost");
		NewCarDao newDao = new NewCarDao(currConn);
		fixexecutorservice.execute(new NewCarCrawl(null, newDao));
		fixexecutorservice.shutdown();
	}
}
